package com.cloudwebrtc.voip.sipenginev2.impl;

import com.cloudwebrtc.voip.sipenginev2.CallReport;
import com.cloudwebrtc.voip.sipenginev2.CallReportStatus;
import com.cloudwebrtc.voip.sipenginev2.Direction;

public class CallReportImpl implements CallReport {
	//implement for CallReport_JNI.cpp
	private long nativePtr = 0;
	private native int GetDirection(long nativePtr);
	private native String From(long nativePtr);
	private native String To(long nativePtr);
	private native int GetCallReportStatus(long nativePtr);
	private native String GetStartTime(long nativePtr);
	private native String GetConnectTime(long nativePtr);
	private native String GetFinishTime(long nativePtr);
	private native int GetSessionTime(long nativePtr);
	private native int GetDuration(long nativePtr);
	private native boolean IsVideoCall(long nativePtr);
	private native String RecordFile(long nativePtr);
	
	public CallReportImpl(long aNativePtr)
	{
		nativePtr = aNativePtr;
	}

	@Override
	public Direction GetDirection() {
		 return Direction.fromInt(GetDirection(nativePtr));
	}

	@Override
	public String From() {
		return From(nativePtr);
	}

	@Override
	public String To() {
		return To(nativePtr);
	}

	@Override
	public CallReportStatus GetCallReportStatus()
	{
		return CallReportStatus.fromInt(GetCallReportStatus(nativePtr));
	}

	@Override
	public String GetStartTime() {
		return GetStartTime(nativePtr);
	}

	@Override
	public String GetConnectTime() {
		return GetConnectTime(nativePtr);
	}

	@Override
	public String GetFinishTime() {
		return GetFinishTime(nativePtr);
	}

	@Override
	public int GetSessionTime() {
		return GetSessionTime(nativePtr);
	}

	@Override
	public int GetDuration() {
		return GetDuration(nativePtr);
	}

	@Override
	public boolean IsVideoCall() {
		return IsVideoCall(nativePtr);
	}

	@Override
	public String RecordFile() {
		return RecordFile(nativePtr);
	}
}
